import unittest
from api.home import HomeAPI
class TestHomeAPI(unittest.TestCase):
    def setUp(self) -> None:
        self.home_api=HomeAPI()
    def test01_get_banner_info(self):
        response=self.home_api.get_banner_info()
        print(response.json())
        self.assertEqual(200,response.status_code)
        self.assertEqual("轮播图",response.json().get("description"))
    def test02_get_theme_info(self):
        response=self.home_api.get_theme_info()
        print(response.json())
        self.assertEqual(200,response.status_code)
        self.assertIn("专题栏",response.json()[0].get("name"))
    def test03_get_recent_info(self):
        response=self.home_api.get_recent_info()
        print(response.json())
        self.assertEqual(200,response.status_code)
        self.assertIn("芹菜",response.json()[0].get("name"))
